﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_Quota_Detail
    Inherits System.Web.UI.UserControl
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not Request.QueryString("Id").ToString.Equals("0") Then
                hidID.Value = Request.QueryString("Id")
                ShowData()
            End If
        End If
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            Dim p As Quota = (From q In data.Quotas Where q.Id = hidID.Value Select q).SingleOrDefault
            If Not p Is Nothing Then
                lblQuotanumber.Text = IIf(IsNothing(p.QuotaNumber) = True, "", p.QuotaNumber)
                lblStoreid.Text = IIf(IsNothing(p.StoreId) = True, "", p.StoreId)
                lblDvdcode.Text = IIf(IsNothing(p.ProductCode) = True, "", p.ProductCode)
                lblTotal.Text = IIf(IsNothing(p.Total) = True, "", p.Total)
            End If
        End Using
    End Sub
#End Region
End Class
